<!DOCTYPE html>
<html lang="zh" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="book">
<meta name="generator" content="Paradox, paradox-material-theme=0.6.0, mkdocs-material=3.0.3">

<meta name="lang:clipboard.copy" content="Copy to clipboard">
<meta name="lang:clipboard.copied" content="Copied to clipboard">
<meta name="lang:search.language" content="">
<meta name="lang:search.pipeline.stopwords" content="true">
<meta name="lang:search.pipeline.trimmer" content="true">
<meta name="lang:search.result.none" content="No matching documents">
<meta name="lang:search.result.one" content="1 matching document">
<meta name="lang:search.result.other" content="# matching documents">
<meta name="lang:search.tokenizer" content="[\s\-]+">


<meta name="description" content="book">
<link rel="shortcut icon" href="../assets/images/favicon.png">
<title>使用 Akka Http 搭建一个简单的 Web 服务 · Scala Web 开发——基于Akka HTTP</title>
<link rel="stylesheet" href="../assets/stylesheets/application.451f80e5.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.22915126.css">
<meta name="theme-color" content="#009688" />
<link rel="stylesheet" href="../lib/material__tabs/dist/mdc.tabs.min.css">
<link rel="stylesheet" href="../lib/prettify/prettify.css">
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
<style>
body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}
code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}
</style>
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
<link rel="stylesheet" href="../assets/stylesheets/paradox-material-theme.css">
</head>
<body
data-md-color-primary="teal"
data-md-color-accent="indigo"
>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="../index.html" title="Scala Web 开发——基于Akka HTTP" class="md-header-nav__button md-logo">
<i class="md-icon">local_library</i>
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">
Scala Web 开发——基于Akka HTTP
</span>
<span class="md-header-nav__topic">
使用 Akka Http 搭建一个简单的 Web 服务
</span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">&#xE5CD;</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
Type to start searching
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>

</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/yangbajing/scala-web-development"
title="Go to repository"
class="md-source"
data-md-source="github">
<div class="md-source__icon">
<i class="fa fa-github"></i>
</div>
<div class="md-source__repository">
yangbajing/scala-web-development
</div>
</a>

</div>
</div>
</div>
</nav>
</header>

<div class="md-container">
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0" style="visibility: hidden">
<label class="md-nav__title md-nav__title--site" for="drawer">
<a href="../index.html" title="Scala Web 开发——基于Akka HTTP" class="md-nav__button md-logo">
<span class="md-nav__button md-logo">
<i class="md-icon">local_library</i>
</a>
<a href="../index.html" title="Scala Web 开发——基于Akka HTTP">
Scala Web 开发——基于Akka HTTP
</a>
</label>
<div class="md-nav__source">
<a href="https://github.com/yangbajing/scala-web-development"
title="Go to repository"
class="md-source"
data-md-source="github">
<div class="md-source__icon">
<i class="fa fa-github"></i>
</div>
<div class="md-source__repository">
yangbajing/scala-web-development
</div>
</a>

</div>
<ul>
  <li><a href="../preface.html" class="page">前言</a></li>
  <li><a href="../env/index.html" class="page">Scala 环境配置</a>
  <ul>
    <li><a href="../env/env.1.html" class="page">Sbt</a></li>
    <li><a href="../env/env.2.html" class="page">IDE开发工具</a></li>
    <li><a href="../env/env.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../scala/index.html" class="page">Scala 语言基础</a>
  <ul>
    <li><a href="../scala/scala.0.html" class="page">REPL</a></li>
    <li><a href="../scala/scala.1.html" class="page">你好，Scala</a></li>
    <li><a href="../scala/scala.2.html" class="page">Scala基础</a></li>
    <li><a href="../scala/scala.3.html" class="page">流程和函数</a></li>
    <li><a href="../scala/scala.4.html" class="page">集合</a></li>
    <li><a href="../scala/scala.5.html" class="page">class和object</a></li>
    <li><a href="../scala/scala.6.html" class="page">函数式</a></li>
    <li><a href="../scala/scala.7.html" class="page">Trait</a></li>
    <li><a href="../scala/scala.8.html" class="page">并发</a></li>
    <li><a href="../scala/scala.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../basic/index.html" class="page">Akka HTTP 基础</a>
  <ul>
    <li><a href="../basic/basic.0.html" class="page">Akka HTTP 基础</a></li>
    <li><a href="../basic/basic.1.html" class="page">Web 工作方式</a></li>
    <li><a href="../basic/basic.2.html" class="active page">使用 Akka Http 搭建一个简单的 Web 服务</a></li>
    <li><a href="../basic/basic.3.html" class="page">Akka HTTP 的通用抽象</a></li>
    <li><a href="../basic/basic.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../server-api/index.html" class="page">服务端API</a>
  <ul>
    <li><a href="../server-api/work.html" class="page">Akka HTTP 如何使得 Web 工作</a></li>
    <li><a href="../server-api/advanced.html" class="page">高级服务端 API</a></li>
  </ul></li>
  <li><a href="../routing-dsl/index.html" class="page">路由DSL</a>
  <ul>
    <li><a href="../routing-dsl/route.html" class="page">Route 路由</a></li>
    <li><a href="../routing-dsl/directive.html" class="page">Directive 指令</a></li>
    <li><a href="../routing-dsl/custom-directive.html" class="page">自定义指令</a></li>
    <li><a href="../routing-dsl/rejections.html" class="page">拒绝 rejections</a></li>
    <li><a href="../routing-dsl/exception.html" class="page">异常处理</a></li>
    <li><a href="../routing-dsl/file-upload.html" class="page">实战：大文件断点上传、下载和秒传</a></li>
  </ul></li>
  <li><a href="../directives/index.html" class="page">常用指令</a>
  <ul>
    <li><a href="../directives/path.html" class="page">PathDirectives（路径指令）</a></li>
    <li><a href="../directives/method.html" class="page">directives/method.html</a></li>
    <li><a href="../directives/parameter_form.html" class="page">directives/parameter_form.html</a></li>
    <li><a href="../directives/marshalling.html" class="page">directives/marshalling.html</a></li>
    <li><a href="../directives/file.html" class="page">directives/file.html</a></li>
    <li><a href="../directives/cookie.html" class="page">directives/cookie.html</a></li>
  </ul></li>
  <li><a href="../data/index.html" class="page">数据</a>
  <ul>
    <li><a href="../data/data.0.html" class="page">数据</a></li>
    <li><a href="../data/data.1.html" class="page">JSON</a></li>
    <li><a href="../data/data.ant-design-pro.html" class="page">实战：为Ant Design Pro提供后端接口</a></li>
    <li><a href="../data/data.kryo.html" class="page">Kryo</a></li>
    <li><a href="../data/data.2.html" class="page">Protobuf</a></li>
    <li><a href="../data/data.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../test/index.html" class="page">测试</a>
  <ul>
    <li><a href="../test/test.0.html" class="page">测试</a></li>
    <li><a href="../test/test.1.html" class="page">Scalatest</a></li>
    <li><a href="../test/test.2.html" class="page">测试异步代码</a></li>
    <li><a href="../test/test.3.html" class="page">端到端测试Route</a></li>
    <li><a href="../test/test.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../actor/index.html" class="page">Akka Actor</a>
  <ul>
    <li><a href="../actor/actor.html" class="page">Akka Typed Actor</a></li>
    <li><a href="../actor/actor-test.html" class="page">Akka Actor 测试</a></li>
    <li><a href="../actor/actor.z.html" class="page">Actor小结</a></li>
  </ul></li>
  <li><a href="../oauth/index.html" class="page">实战：实现OAuth 2服务</a>
  <ul>
    <li><a href="../oauth/oauth.0.html" class="page">实战：OAuth 2 服务</a></li>
    <li><a href="../oauth/oauth.1.html" class="page">OAuth 2简介</a></li>
    <li><a href="../oauth/oauth.2.html" class="page">OAuth 2接口设计</a></li>
    <li><a href="../oauth/oauth.3.html" class="page">OAuth 2服务实现</a></li>
    <li><a href="../oauth/oauth.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../database/index.html" class="page">访问数据库</a>
  <ul>
    <li><a href="../database/database.0.html" class="page">访问数据库</a></li>
    <li><a href="../database/database.1.html" class="page">使用 JDBC 访问 PostgreSQL</a></li>
    <li><a href="../database/database.2.html" class="page">使用 Slick 访问数据库</a></li>
    <li><a href="../database/database.3.html" class="page">访问 Cassandra 数据库</a></li>
    <li><a href="../database/database.4.html" class="page">访问 Redis</a></li>
    <li><a href="../database/database.5.html" class="page">访问 Elasticsearch</a></li>
    <li><a href="../database/database.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../engineering/index.html" class="page">工程化</a>
  <ul>
    <li><a href="../engineering/swagger.html" class="page">使用Swagger编写API文档</a></li>
    <li><a href="../engineering/guice.html" class="page">使用Guice管理类依赖</a></li>
  </ul></li>
  <li><a href="../grpc/index.html" class="page">Akka gRPC</a>
  <ul>
    <li><a href="../grpc/grpc.html" class="page">gRPC服务</a></li>
    <li><a href="../grpc/build-tool.html" class="page">构建工具</a></li>
    <li><a href="../grpc/deployment.html" class="page">部署</a></li>
    <li><a href="../grpc/grpc.z.html" class="page">小结</a></li>
  </ul></li>
  <li><a href="../config-discovery/index.html" class="page">实战：配置管理、服务发现系统</a></li>
  <li><a href="../appendix/index.html" class="page">附录</a>
  <ul>
    <li><a href="../appendix/appendix.0.html" class="page">参考资料</a></li>
    <li><a href="../appendix/appendix.1.html" class="page">专业术语</a></li>
    <li><a href="../appendix/appendix.2.html" class="page">词汇表</a></li>
  </ul></li>
  <li><a href="../donate.html" class="page">赞助</a></li>
</ul>
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul>
  <li><a href="../basic/basic.2.html#使用-akka-http-搭建一个简单的-web-服务" class="header">使用 Akka Http 搭建一个简单的 Web 服务</a>
  <ul>
    <li><a href="../basic/basic.2.html#第一个服务" class="header">第一个服务</a></li>
    <li><a href="../basic/basic.2.html#route" class="header">Route</a></li>
    <li><a href="../basic/basic.2.html#json" class="header">JSON</a></li>
    <li><a href="../basic/basic.2.html#route类型" class="header">Route类型</a></li>
  </ul></li>
</ul>
</nav>

</nav>
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 1.0.0
</label>
</li>
</ul>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Table of contents</label>
<ul>
  <li><a href="../basic/basic.2.html#使用-akka-http-搭建一个简单的-web-服务" class="header">使用 Akka Http 搭建一个简单的 Web 服务</a>
  <ul>
    <li><a href="../basic/basic.2.html#第一个服务" class="header">第一个服务</a></li>
    <li><a href="../basic/basic.2.html#route" class="header">Route</a></li>
    <li><a href="../basic/basic.2.html#json" class="header">JSON</a></li>
    <li><a href="../basic/basic.2.html#route类型" class="header">Route类型</a></li>
  </ul></li>
</ul>
</nav>

</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<div class="md-content__searchable">
<h1><a href="#使用-akka-http-搭建一个简单的-web-服务" name="使用-akka-http-搭建一个简单的-web-服务" class="anchor"><span class="anchor-link"></span></a>使用 Akka Http 搭建一个简单的 Web 服务</h1>
<p>使用 Akka HTTP 需要对 <code>akka-http</code> 的依赖，请把如下配置写入你的 Sbt 工程配置文件中：</p>
<pre class="prettyprint"><code class="language-sbt">&quot;com.typesafe.akka&quot; %% &quot;akka-http&quot; % &quot;10.1.5&quot;
</code></pre>
<h2><a href="#第一个服务" name="第一个服务" class="anchor"><span class="anchor-link"></span></a>第一个服务</h2>
<p>从官方提供的 <code>HttpApp</code> 特质开始，它提供了快捷的方式来启动一个Akka HTTP Server。</p>
<pre class="prettyprint"><code class="language-scala">class WebServer extends HttpApp {
  def route: Route =
    path(&quot;hello&quot;) {
      get {
        import akka.http.scaladsl.marshallers.xml.ScalaXmlSupport._
        complete(&lt;h1&gt;Say hello to akka-http&lt;/h1&gt;)
      }
    }
}
</code></pre>
<p><code>path(&quot;hello&quot;)</code>定义了一个HTTP访问路由，<code>get</code>代表这个路由提供了 <strong>GET</strong> 请示，而<code>complete</code>函数允许我们提供响应结果来完成这个路由定义，这里我们返回了一段文本。Akka Http的路由看起来向 <strong>声明式</strong> 的，以一直新颖而又直观的方式来定义HTTP服务。</p>
<p>用户第一次接触这种函数套函数（又像树型结构）的代码方式可能不大习惯，其实我们可以换种方式来实现这段代码：</p>
<pre class="prettyprint"><code class="language-scala">  def traditionRoute: Route = {
    val respResult = complete(&quot;result&quot;) // 响应结果
    val hPath = path(&quot;hello&quot;) // 绑定的HTTP访问路径
    hPath(get(result)) 
  }
</code></pre>
<p><code>路径(Http方法(结果))</code>，我们用Java式的风格来实现同样的功能。这样是不是更符合你对代码的预期？</p>
<p>让我们来启动服务：</p>
<pre class="prettyprint"><code class="language-scala">object Boot {
  def main(args: Array[String]): Unit = {
    val server = new WebServer
    server.startServer(&quot;0.0.0.0&quot;, 8888)
  }
}
</code></pre>
<p>通过 <code>curl</code> 命令来测试下我们的第一个Akka HTTP服务（-i选项可以打印HTTP响应头）：</p>
<pre class="prettyprint"><code class="language-sh">curl -i http://localhost:8888/hello
HTTP/1.1 200 OK
Server: akka-http/10.0.11
Date: Sat, 24 Feb 2018 17:05:12 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 31

&lt;h1&gt;Say hello to akka-http&lt;/h1&gt;
</code></pre>
<h2><a href="#route" name="route" class="anchor"><span class="anchor-link"></span></a>Route</h2>
<p>Akka HTTP 提供了一个灵活的 <strong>DSL</strong> ，它有很多可组合的元素（Directive 指令）以简洁、易读的方式来构建服务。让我们来看下面这个示例：</p>
<pre class="prettyprint"><code class="language-scala">  path(&quot;book&quot;) {
    get {
      parameters(&#39;name.as[Option[String]], &#39;isbn.as[Option[String]], &#39;author.as[Option[String]]) {
        (maybeName, maybeIsbn, maybeAuthor) =&gt;
          complete(s&quot;name: $maybeName, isbn: $maybeIsbn, author: $maybeAuthor&quot;)
      }
    }
  }
</code></pre>
<p>对于上面这个定义，类似的 <strong>Play</strong> 路由定义如：</p>
<pre><code>GET  /book controller.Page.book(name: Option[String], isbn: Option[String], author: Option[String)
</code></pre>
<p>我们可以看到，对一个API路由的定义拆成了几个函数嵌套的形式。<code>path</code>指定访问路径，<code>get</code>决定这个API提供HTTP GET服务，<code>parameters</code>可以提取请求参数，而<code>complete</code>将一个字符串返回给前端。</p>
<h2><a href="#json" name="json" class="anchor"><span class="anchor-link"></span></a>JSON</h2>
<p>现在大部分的服务都提供JSON格式的数据，Akka HTTP提供了 Mashaller/Unmashaller机制，用户可以基于此灵活的定制自己的序列化/反序列化方式。这里我们使用 Jackson 来解析/处理 JSON。</p>
<p>首选，我们实现自定义的 Mashaller/Unmashaller：</p>
<pre class="prettyprint"><code class="language-scala">trait JacksonSupport {

  private val jsonStringUnmarshaller =
    Unmarshaller.byteStringUnmarshaller
      .forContentTypes(MediaTypes.`application/json`)
      .mapWithCharset {
        case (ByteString.empty, _) =&gt; throw Unmarshaller.NoContentException
        case (data, charset) =&gt; data.decodeString(charset.nioCharset.name)
      }

  // HTTP entity =&gt; `A`
  implicit def unmarshaller[A](
                                implicit ct: ClassTag[A],
                                objectMapper: ObjectMapper = Jackson.defaultObjectMapper
                              ): FromEntityUnmarshaller[A] =
    jsonStringUnmarshaller.map(
      data =&gt; objectMapper.readValue(data, ct.runtimeClass).asInstanceOf[A]
    )

  // `A` =&gt; HTTP entity
  implicit def marshaller[A](
                              implicit objectMapper: ObjectMapper = Jackson.defaultObjectMapper
                            ): ToEntityMarshaller[A] = {
    JacksonHelper.marshaller[A](objectMapper)
  }

}
</code></pre>
<p>实现自定义的 Marshaller/Unmarshaller 后，我们就可以在 Akka HTTP 中提供 Json 支持了。</p>
<pre class="prettyprint"><code class="language-scala">package akkahttp.foundation.route

import akka.http.scaladsl.server.Route
import akkahttp.foundation.data.domain.PageInput
import akkahttp.json.JacksonSupport._
import akkahttp.server.BaseRoute

class PageRoute extends BaseRoute {

  def route: Route =
    path(&quot;page&quot;) {
      post {
        entity(as[PageInput]) { pageInput =&gt;
          complete(pageInput)
        }
      }
    }

}
</code></pre>
<p>Akka HTTP使用了Scala的隐式转换特性来自定义数据序列化，这是一个非侵入式的设计，用户可以在每个模块选择自己的数据序列化方式。</p>
<h2><a href="#route类型" name="route类型" class="anchor"><span class="anchor-link"></span></a>Route类型</h2>
<p><strong>Route</strong> 是 Akka HTTP 路由 DSL 里的核心概念，用它构建的所有结构，不管是一条线还是很多条线组成，它们都会是这个类型的实例。</p>
<pre class="prettyprint"><code class="language-scala">type Route = RequestContext =&gt; Future[RouteResult]
</code></pre>
<h3><a href="#组合路由" name="组合路由" class="anchor"><span class="anchor-link"></span></a>组合路由</h3>
<p>Akka HTTP 提供3个基本的操作来让我们创建更复杂的路由链：</p>
<ol>
  <li>路由转换：它代理一个“内部”的路由，并在这个过程中改变一些请求传入的属性，然后传出响应或两者。</li>
  <li>路由过滤：只允许满足给定条件的请求被传递，并拒绝所有其它访问请求。</li>
  <li>路由链：如果第一个请求被拒绝，将尝试第二个路由。使用 <code>~</code> 操作符连接多个路由定义。</li>
</ol>
<p>Akka HTTP 实现了很多默认的指令 <code>akka.http.scaladsl.server.Directives._</code> ，你也可以很轻松地创建自己的指令。指令提供了强大和灵活的方式来构建 Akka HTTP。</p>
<h3><a href="#路由树" name="路由树" class="anchor"><span class="anchor-link"></span></a>路由树</h3>
<p>当通过嵌套和操作符组合指令和自定义路径时，将构建一个路由结构并形成一颗树。当一个 HTTP 请求进来，它将从根进行这颗树，并以深度优先的方式流过所有分支，直到某个节点完成或全部被拒绝为止。</p>
<pre class="prettyprint"><code class="language-scala">val route =
  a {
    b {
      c {
        ... // route 1
      } ~
      d {
        ... // route 2
      } ~
      ... // route 3
    } ~
    e {
      ... // route 4
    }
  }
</code></pre>
<p>这里由5个指令构建了一个路由树：</p>
<ol>
  <li>当 a, b, c都通过，才到到达路由 1</li>
  <li>当 a 和 b 通过，但 c 被拒绝且 d 通过，将到达路由 2</li>
  <li>当 a 和 b 通过，但 c 和 d 被拒绝，路由 3 被到达</li>
</ol>
<p>若路由 3 前面的请求都被拒绝，则它将“捕获”所有请求。这个机制使复杂的过滤逻辑可以很容易的实现。把简单和最具体的放在顶端，一般和普通的放到最后。</p>
</div>
<div>
<a href="https://github.com/yangbajing/scala-web-development/tree/master/book/src/main/paradox/basic/basic.2.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
1.0.0
</span>
</div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="../basic/basic.1.html" title="Web 工作方式" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
Web 工作方式
</span>
</div>
</a>
<a href="../basic/basic.3.html" title="Akka HTTP 的通用抽象" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
Akka HTTP 的通用抽象
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Powered by
<a href="https://github.com/lightbend/paradox">Paradox</a>
and
<a href="https://jonas.github.io/paradox-material-theme/">Paradox Material Theme</a>

</div>
<div class="md-footer-social">
<a href="https://github.com/yangbajing" class="md-footer-social__link fa fa-github"></a><a href="https://weibo.com/yangbajing" class="md-footer-social__link fa fa-globe"></a><a href="https://www.yangbajing.me/" class="md-footer-social__link fa fa-globe"></a>
</div>

</div>
</div>
</footer>

</div>
<script src="../assets/javascripts/application.583bbe55.js"></script>
<script src="../assets/javascripts/paradox-material-theme.js"></script>
<script>app.initialize({version:"0.17",url:{base:"../."}})</script>
<script type="text/javascript" src="../lib/prettify/prettify.js"></script>
<script type="text/javascript" src="../lib/prettify/lang-scala.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
window.prettyPrint && prettyPrint();
});
</script>
</body>
</html>
